package com.wzj.yygh.common.utils;


import javax.servlet.http.HttpServletRequest;

public class AuthContextHolder {

    //获取当前用户id
    public static Long getUserId(HttpServletRequest request) {
        String token = request.getHeader("token");
        return JwtHelper.getUserId(token);
    }

    //校验token是否合法
    public static void checkAuth(HttpServletRequest request) {
        String token = request.getHeader("token");
        JwtHelper.parseToken(token);
    }
}
